package kr.hkit.powerjava.chapter15;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class GraphicTest extends JFrame {

	private JPanel contentPane;
//	private MyPanel panel;
	private ChangePanel panel;
	private ColorChooserPanel panel_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GraphicTest frame = new GraphicTest();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GraphicTest() {
		initialize();
	}
	private void initialize() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 629, 720);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
//		panel = new MyPanel();
		panel = new ChangePanel();
		contentPane.add(panel, BorderLayout.CENTER);
		
		panel_1 = new ColorChooserPanel();
		contentPane.add(panel_1, BorderLayout.NORTH);
	}

	//과제: 처음에 changePanel의 버튼을 이용해서 누르면 ColorChooserPanel의 색상 선택 창이 나오고
	//그 후에 선택을 하면 그 색상으로 fillRect로 호출
}
